package workFlow;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class FileDownLoad extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse response)
			throws ServletException, IOException {
		String fileName = "workFlow.xml";
		
		response.reset();
		response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
		response.setContentType("application/octet-stream");
		response.setCharacterEncoding("UTF-8");
		
		PrintWriter out = response.getWriter();
		StringBuilder sb = new StringBuilder();
		sb.append("wokao success!");
		
		out.write(sb.toString());
		
		
		
		out.flush();
		out.close();
	}

	
}
